<header class="page-header">
  {{key-value-header
    baseKey=key
    path="vault.cluster.secrets.backend.list"
    mode=mode
    root=root
    showCurrent=true
  }}
  <div class="level">
    <div class="level-left">
      <h1 class="title is-3">
        {{#if (eq mode "create") }}
          Create Encryption Key
        {{else if (eq mode "edit") }}
          Edit Encryption Key
        {{else}}
          Encryption Key <code>{{key.id}}</code>
        {{/if}}
      </h1>
    </div>
    <div class="level-right">
      <div class="field is-grouped">
        {{#if (eq mode "show") }}
          {{#if (or capabilities.canUpdate capabilities.canDelete)}}
            <div class="control">
              {{#secret-link
                secret=key.id
                mode="edit"
                replace=true
                class="button has-icon-right is-ghost is-compact"
                }}
                Edit encryption key
                {{i-con glyph="chevron-right" size=11}}
              {{/secret-link}}
            </div>
          {{/if}}
          <div class="control">
            {{#secret-link
              mode="actions"
              secret=key.id
              class="button has-icon-right is-ghost is-compact"
              data-test-transit-key-actions-link=true
            }}
              Key actions
              {{i-con glyph="chevron-right" size=11}}
            {{/secret-link}}
          </div>
        {{/if}}
      </div>
    </div>
  </div>
</header>

{{partial (concat 'partials/transit-form-' mode)}}
